package com.example;

public class Course {
    private int id;
    private String name;
    private double credits;
    private String department;
    private String description;
    private String courseType; // 必修/选修
    private String semester; // 开课学期

    public Course(int id, String name, double credits, String department, String description, String courseType, String semester) {
        this.id = id;
        this.name = name;
        this.credits = credits;
        this.department = department;
        this.description = description;
        this.courseType = courseType;
        this.semester = semester;
    }

    // Getters
    public int getId() { return id; }
    public String getName() { return name; }
    public double getCredits() { return credits; }
    public String getDepartment() { return department; }
    public String getDescription() { return description; }
    public String getCourseType() { return courseType; }
    public String getSemester() { return semester; }

    // Setters
    public void setId(int id) { this.id = id; }
    public void setName(String name) { this.name = name; }
    public void setCredits(double credits) { this.credits = credits; }
    public void setDepartment(String department) { this.department = department; }
    public void setDescription(String description) { this.description = description; }
    public void setCourseType(String courseType) { this.courseType = courseType; }
    public void setSemester(String semester) { this.semester = semester; }

    @Override
    public String toString() {
        return name;
    }
} 